package com.yvtong.Service;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.yvtong.entity.yonghu;
import com.yvtong.util.DBManager;
import com.yvtong.util.QueryDataResult;

public class YonghuManager {
	public yonghu chaxun(String name) {
		yonghu y = null;
		String sql = String.format("select* from yonghu where  zhanghao = '%s'", name);
		QueryDataResult qrd = DBManager.executeQuery(sql);
		ResultSet rs = qrd.rs;
		if (rs != null) {
			try {
				while (rs.next()) {

					int id=rs.getInt("id");
					String n = rs.getString("zhanghao");
					String psd = rs.getString("mima");

					y = new yonghu(n, psd);
				}
			} catch (SQLException e) {

				e.printStackTrace();
			}
		}

		qrd.close();
		return y;
	}
}
